import request from "../utils/request.js"

export function add(data) {
	return request({
		url: "/cart/add",
		method: 'post',
		data
	})
}

//购物车列表
export function getCart(data) {
	return request({
		url: "/cart/getCart",
		data
	})
}
//更新购物车
export function updateCart(data) {
	return request({
		url: "/cart/updateCart",
		method: 'post',
		data
	})
}
//更新购物车
export function delCart(data) {
	return request({
		url: "/cart/delCart",
		method: 'DELETE',
		data
	})
}
//获取下单商品
export function getOrderPreGoods(data) {
	return request({
		url: "/order/getOrderPreGoods",
		data
	})
}
//获取用户默认地址
export function getOrderDefaultAddress(data) {
	return request({
		url: "/order/getOrderDefaultAddress",
		data
	})
}

//下单
export function buyNow(data) {
	return request({
		url: "/order/buyNow",
		method: 'post',
		data
	})
}
//取消订单
export function cancelOrder(data) {
	return request({
		url: "/order/cancelOrder",
		method: 'post',
		data
	})
}

//确认收货
export function receipt(data) {
	return request({
		url: "/order/receipt",
		method: 'post',
		data
	})
}
//退款
export function refund(data) {
	return request({
		url: "/order/refund",
		method: 'post',
		data
	})
}


//订单列表
export function OrderList(data) {
	return request({
		url: "/order/OrderList",
		data
	})
}
//订单详情
export function OrderDetail(data) {
	return request({
		url: "/order/detail",
		data
	})
}